<template>
  <div>
    <div style="display: flex;align-items: center;justify-content: center;margin-top: 50px">
      <el-card style="width: 80%">
        <div style="height: 50px;font-size: 25px">商家推广活动申请</div>
        <div style="display: flex;justify-content: center;margin-top: 20px">
          <div>
            <div>该活动旨在为我们的用户提供更好的住宿体验，并同时帮助酒店商家进行推广和增加知名度</div>
            <p>参与本活动，您将获得以下好处：</p>
            <div>1.通过我们的预约管理系统，您的酒店信息将得到广泛宣传，吸引更多用户关注和选择。</div>
            <div>2.潜在客户引流：活动期间，我们将为您引入大量潜在客户，提供预订和销售的机会，助力您的业务增长。</div>
            <div>
              3.优惠券兑换：我们的积分系统将为用户提供兑换优惠券的机会，这不仅能够吸引更多客户入住贵酒店，也为您提供了促销和销售的手段。
            </div>
          </div>
        </div>
        <div style="display: flex;justify-content: center;margin-top: 50px">
          <el-button type="primary" @click="application()">立即申请</el-button>
        </div>
      </el-card>
    </div>
  </div>
</template>

<script>
export default {
  name: "pointsApplication",
  data() {
    return {
      user: JSON.parse(localStorage.getItem('user') || '{}'),
      hotel: [],
      hotelData: {},
      hotel_id: "",
    }
  },
  methods: {
    load_business_id() {
      this.$request.post('/hotel_search/', {
        "business_id": this.user.id,
      }).then(res => {
        if (res.code === '200') {
          this.hotel = res.data.hotel_list;
          const length = this.hotel.length;
          this.hotel_id = this.hotel[length - 1].id;
          this.hotelData = this.hotel[length - 1]
          console.log(this.hotelData)
        } else if (res.code === '501') {
        } else {
          this.$message.error(res.msg)
        }
      })
    },
    application() {
      this.$request.post('/activity_apply/', {
        "user_id": this.user.id,
      }).then(res => {
        if (res.code === '200') {
          this.$message.success("提交申请成功")
        } else {
          this.$message.warning("已提交申请")
        }
      })
    },
    created() {
      this.load_business_id()
    }
  }
}
</script>

<style scoped>

</style>